import config from '@/utils/config';
import { MockMethod } from 'vite-plugin-mock';

// 获取地址列表
const getAddressList = {
  url: config.url.address_list,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: [
        {
          id: 1,
          consignee: '暗影',
          mobile: '13766668888',
          area: '110114',
          address: '北七家镇平西府村',
          default: '1',
        },
        {
          id: 2,
          consignee: '暗影2',
          mobile: '13766668888',
          area: '110111',
          address: '北七家镇宏福苑小区1号楼3单元401',
          default: '0',
        },
        {
          id: 3,
          consignee: '暗影3',
          mobile: '13766668888',
          area: '371522',
          address: '柿子园镇堰里铺东街110号',
          default: '0',
        },
        {
          id: 4,
          consignee: '暗影4',
          mobile: '13766668888',
          area: '110113',
          address: '北七家镇宏福苑小区1号楼3单元401',
          default: '0',
        },
        {
          id: 5,
          consignee: '暗影5',
          mobile: '13766668888',
          area: '110115',
          address: '北七家镇宏福苑小区1号楼3单元401',
          default: '0',
        },
      ],
      message: 'success',
    };
  },
};

// 地址
const getAddressInfo = {
  url: config.url.address_info,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: {
        id: 4,
        consignee: '暗影4',
        mobile: '13766668888',
        area: '110113',
        address: '北七家镇宏福苑小区1号楼3单元401',
        default: '1',
      },
      message: 'success',
    };
  },
};

// 新增地址
const addAddress = {
  url: config.url.address_add,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 编辑地址
const editAddress = {
  url: config.url.address_edit,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 删除地址
const deleteAddress = {
  url: config.url.address_delete,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

export default [
  getAddressList,
  getAddressInfo,
  addAddress,
  editAddress,
  deleteAddress,
] as MockMethod[];
